package com.unionpay.mpds.model;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Branch entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_BRANCH", uniqueConstraints = @UniqueConstraint(columnNames = "BRANCH_NO"))
public class Branch implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 711231794516529523L;
	private String branchNo;
	private String branchName;
	private String branchLevel;
	private String branchStatus;
	private String branchNoP;
	private String branchAddress;
	private String branchZip;
	private String branchManager;
	private String branchTel;
	private String branchFax;
	private String branchEmail;

	// Constructors

	/** default constructor */
	public Branch() {
	}

	/** minimal constructor */
	public Branch(String branchNo, String branchName, String branchLevel,
			String branchStatus, String branchNoP) {
		this.branchNo = branchNo;
		this.branchName = branchName;
		this.branchLevel = branchLevel;
		this.branchStatus = branchStatus;
		this.branchNoP = branchNoP;
	}

	/** full constructor */
	public Branch(String branchNo, String branchName, String branchLevel,
			String branchStatus, String branchNoP, String branchAddress,
			String branchZip, String branchManager, String branchTel, String branchFax,
			String branchEmail) {
		this.branchNo = branchNo;
		this.branchName = branchName;
		this.branchLevel = branchLevel;
		this.branchStatus = branchStatus;
		this.branchNoP = branchNoP;
		this.branchAddress = branchAddress;
		this.branchZip = branchZip;
		this.branchManager = branchManager;
		this.branchTel = branchTel;
		this.branchFax = branchFax;
		this.branchEmail = branchEmail;
	}

	// Property accessors

	@Id
	@Column(name = "BRANCH_NO", unique = true, nullable = false, length = 15)
	public String getBranchNo() {
		return this.branchNo;
	}

	public void setBranchNo(String branchNo) {
		this.branchNo = branchNo;
	}

	@Column(name = "BRANCH_NAME", nullable = false, length = 40)
	public String getBranchName() {
		return this.branchName;
	}

	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}

	@Column(name = "BRANCH_LEVEL", nullable = false, length = 1)
	public String getBranchLevel() {
		return this.branchLevel;
	}

	public void setBranchLevel(String branchLevel) {
		this.branchLevel = branchLevel;
	}

	@Column(name = "BRANCH_STATUS", nullable = false, length = 1)
	public String getBranchStatus() {
		return this.branchStatus;
	}

	public void setBranchStatus(String branchStatus) {
		this.branchStatus = branchStatus;
	}

	@Column(name = "BRANCH_NO_P", nullable = false, length = 15)
	public String getBranchNoP() {
		return this.branchNoP;
	}

	public void setBranchNoP(String branchNoP) {
		this.branchNoP = branchNoP;
	}

	@Column(name = "BRANCH_ADDRESS", length = 80)
	public String getBranchAddress() {
		return this.branchAddress;
	}

	public void setBranchAddress(String branchAddress) {
		this.branchAddress = branchAddress;
	}

	@Column(name = "BRANCH_ZIP", length = 6)
	public String getBranchZip() {
		return this.branchZip;
	}

	public void setBranchZip(String branchZip) {
		this.branchZip = branchZip;
	}

	@Column(name = "BRANCH_MANAGER", length = 20)
	public String getBranchManager() {
		return branchManager;
	}

	public void setBranchManager(String branchManager) {
		this.branchManager = branchManager;
	}
	
	@Column(name = "BRANCH_TEL", length = 15)
	public String getBranchTel() {
		return branchTel;
	}

	public void setBranchTel(String branchTel) {
		this.branchTel = branchTel;
	}
	
	@Column(name = "BRANCH_FAX", length = 15)
	public String getBranchFax() {
		return branchFax;
	}

	public void setBranchFax(String branchFax) {
		this.branchFax = branchFax;
	}
	
	@Column(name = "BRANCH_EMAIL", length = 40)
	public String getBranchEmail() {
		return branchEmail;
	}

	public void setBranchEmail(String branchEmail) {
		this.branchEmail = branchEmail;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof Branch))
			return false;
		Branch castOther = (Branch) other;

		return ((this.getBranchNo() == castOther.getBranchNo()) || (this
				.getBranchNo() != null && castOther.getBranchNo() != null && this
				.getBranchNo().equals(castOther.getBranchNo())))
				&& ((this.getBranchName() == castOther.getBranchName()) || (this
						.getBranchName() != null
						&& castOther.getBranchName() != null && this
						.getBranchName().equals(castOther.getBranchName())))
				&& ((this.getBranchLevel() == castOther.getBranchLevel()) || (this
						.getBranchLevel() != null
						&& castOther.getBranchLevel() != null && this
						.getBranchLevel().equals(castOther.getBranchLevel())))
				&& ((this.getBranchStatus() == castOther.getBranchStatus()) || (this
						.getBranchStatus() != null
						&& castOther.getBranchStatus() != null && this
						.getBranchStatus().equals(castOther.getBranchStatus())))
				&& ((this.getBranchNoP() == castOther.getBranchNoP()) || (this
						.getBranchNoP() != null
						&& castOther.getBranchNoP() != null && this
						.getBranchNoP().equals(castOther.getBranchNoP())))
				&& ((this.getBranchAddress() == castOther.getBranchAddress()) || (this
						.getBranchAddress() != null
						&& castOther.getBranchAddress() != null && this
						.getBranchAddress()
						.equals(castOther.getBranchAddress())))
				&& ((this.getBranchZip() == castOther.getBranchZip()) || (this
						.getBranchZip() != null
						&& castOther.getBranchZip() != null && this
						.getBranchZip().equals(castOther.getBranchZip())))
				&& ((this.getBranchManager() == castOther.getBranchManager()) || (this
						.getBranchManager() != null
						&& castOther.getBranchManager() != null && this
						.getBranchManager().equals(castOther.getBranchManager())))
				&& ((this.getBranchTel() == castOther.getBranchTel()) || (this
						.getBranchTel() != null && castOther.getBranchTel() != null && this
						.getBranchTel().equals(castOther.getBranchTel())))
				&& ((this.getBranchFax() == castOther.getBranchFax()) || (this
						.getBranchFax() != null && castOther.getBranchFax() != null && this
						.getBranchFax().equals(castOther.getBranchFax())))
				&& ((this.getBranchEmail() == castOther.getBranchEmail()) || (this
						.getBranchEmail() != null
						&& castOther.getBranchEmail() != null && this
						.getBranchEmail().equals(castOther.getBranchEmail())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getBranchNo() == null ? 0 : this.getBranchNo().hashCode());
		result = 37
				* result
				+ (getBranchName() == null ? 0 : this.getBranchName()
						.hashCode());
		result = 37
				* result
				+ (getBranchLevel() == null ? 0 : this.getBranchLevel()
						.hashCode());
		result = 37
				* result
				+ (getBranchStatus() == null ? 0 : this.getBranchStatus()
						.hashCode());
		result = 37 * result
				+ (getBranchNoP() == null ? 0 : this.getBranchNoP().hashCode());
		result = 37
				* result
				+ (getBranchAddress() == null ? 0 : this.getBranchAddress()
						.hashCode());
		result = 37 * result
				+ (getBranchZip() == null ? 0 : this.getBranchZip().hashCode());
		result = 37 * result
				+ (getBranchManager() == null ? 0 : this.getBranchManager().hashCode());
		result = 37 * result
				+ (getBranchTel() == null ? 0 : this.getBranchTel().hashCode());
		result = 37 * result
				+ (getBranchFax() == null ? 0 : this.getBranchFax().hashCode());
		result = 37 * result
				+ (getBranchEmail() == null ? 0 : this.getBranchEmail().hashCode());
		return result;
	}
}